It wont render my website and its template to localhost1313 - html

(Hugo)
I'm receiving this in the terminal when I attempt to run the LocalHost server:
Veers-MacBook:FullFork veergala$ hugo server
Building sites … WARN 2020/09/11 09:15:11 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/09/11 09:15:11 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/09/11 09:15:11 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
| EN
-------------------+-----
Pages | 3
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Built in 33 ms
Watching for changes in /Users/avinashgala/FullFork/{archetypes,content,data,layouts,static}
Watching for config changes in /Users/avinashgala/FullFork/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
WARN 2020/09/11 09:15:32 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
I am new to Hugo/Terminal and I have no idea what to do.
Thank you for your time.

Each of your page has a "Kind": see "Page Kinds"
Hugo looks for a layout in order to render your site:
See "Hugo's Lookup Order"
If you don't have your own layout folder, with those _default layout pages, you can add declare a theme
The name used in the theme definition above must match a folder in /your-site/themes, e.g. /your-site/themes/my-shortcodes.
See "A Beginner’s Guide to Creating a Static Website with Hugo" by Ilya Bodrov as an example.
Don't forget to do:
hugo server -D
The -D option means that drafts should also be displayed on the website.
By default, all content is created in draft mode, so we have to provide this option for now.
This command will display brief statistics about your site and start the server with live reloading enabled. Live reloading simply means that whenever you modify the code, the web page will reload automatically in the browser.

Related

PhpStorm: multiple projects with common core

Due to security reasons, I have to split one project to divisions (client, admin, ...), and deploy them to different web servers. These divisions have one common script base, but each division has its own functions. As an IDE I use PhpStorm.
The question: what is the best way to organize project's structure and settings, so the common core part will be visible for IDE indexing in all project's divisions, but at the same time, being maintained from a single project (perhaps, standalone)?
In Java you can do lib jar files for further linking in various projects.
But how it can be done in PHP?
There are multiple ways of how to reference extra PHP code in a project.
If you plan to actively edit such extra code in the same project (and want to see their TODOs, code inspection warnings, include references in code refactoring etc):
You can just add it as an additional Content Root: Settings/Preferences | Directories. Folder added this way will be treated as a part of the project itself and will be shown as a separate node in the Project View panel (just as the main code, which is a Content Root as well).
Or you can open 2nd project while 1st one is already opened and when asked, just chose "Attach":
It's not going to be full 2 projects in one frame, more like something in between attaching Content Root and having 2 projects opened in separate frames.
https://www.jetbrains.com/help/phpstorm/opening-multiple-projects.html
Simple symlink will also do the job (but you need to place it somewhere in a project, e.g. PROJECT_ROOT/libs/my_symlinked_code). You then will need to provide a path mapping for that folder for debugger (if you will debug it of course) as PHP/Xdebug works with "final/resolved path" while IDE works with the path as is.
If you do not need to actively edit that extra code in the same window (and ignore any TODOs, code inspection warnings and other inspection results etc):
Do it as a composer package then? Composer can use custom sources (e.g. GitHub repo or a folder on a local filesystem).
Just add the path to that folder as a "Include Path" at Settings/Preferences | Languages & Frameworks | PHP --> Include Path tab. Code referenced this way is meant for 3rd party libraries (the code that you just use but not edit, e.g. framework code, your send mail/ORM library etc). Composer packages will also be included here by default.
https://www.jetbrains.com/help/phpstorm/php.html#include-path-tab

Multiple self-content pages

I am trying to migrate Polymer 1 application to Polymer 2. My application comprises one "main" page index.html and one static file "multiple.html".
"index.html" is the first page delivered to client. After users successfully log in to server via index.html, "index.html" creates the following tags inside itself:
menu item 1
menu item 2
menu item 3
After users click on menu item N, server sends over the same file multiple.html. Browser than calls function document.URL to get 1, 2, or 3 as request parameters for data from server to build pages of different contents from the same static file "multiple.html". As such, the browser might now opens one main page and several "instances" of pages spawned from static file multiple.html.
Here is my problem: Polymer 2 allows only one "main" page, which is supposed to be specified in file bower.json. How do I restructure my application so that I can run command
polymer build --js-minifiy --html-minify
and produce the correct compressed files, index.html and multiple.html in particular, in directory build/default?
Edit Please note that because files index.html and multiple.html share many files of custom elements, it is not a good idea to split this one application into two applications.
Edit 2 Many thanks for your inputs! I did not make my question specific enough. I will follow the design pattern illustrated by Polymer Shop and try using Polymer element app-route.
You should provide a polymer.json file in the root of your app.
In there you can define multiple files.
{
"entrypoint": "index.html",
"fragments": [
"multiple.html",
]
}
for more details see
https://www.polymer-project.org/2.0/docs/tools/polymer-json
e.g. you can also provide the js minification and html minification there so you don't have to provide it on command line.

PhpStorm insert current namespace

I want the PhpStorm to insert current namespace by default or with a hotkey or with live templates.
Whet I create new Php class ("New | PHP Class" dialog) there is a field for a namespace. Is there a way for it to be filled automatically? It does not look a big deal because in my case a namespace is just directory path (I use composer) starting from src. My search efforts did not give my anything about this at all. Looks like PhpStrom does not have this feauture. But maybe there is some plugin or a hack?
New | PHP Class dialog should fill the namespace automatically based on the directory where file will be created. If it does not then you have not configured your project properly.
Settings/Preferences | Directories -- ensure that your src folder is marked as Source Root. That's depends on project, of course: for Laravel project you need to map app folder to App\ namespace (typical case).
PhpStorm can also detect source roots from your composer.json settings and can even keep it in sync since 2017.2 version (see https://blog.jetbrains.com/phpstorm/2017/07/configuring-with-composer-in-phpstorm-2017-2/).
Some links to read (official help pages):
https://www.jetbrains.com/help/phpstorm/configuring-php-namespaces-in-a-project.html
https://www.jetbrains.com/help/phpstorm/configuring-content-roots.html
https://www.jetbrains.com/help/phpstorm/directories.html

What is the proper way to set modifiable install path in PackageMaker?

First of all, I'm talking about PackageMaker, a GUI application; not packagemaker, a command-line program.
I'm trying to make a install package that has three components, installed in different locations:
XxxxBin.app application, default installed to /Applications;
Xxxx.bundle plugin bundle, default installed to /Library/Audio/Plug-Ins/VST/ (and renamed to Xxxx.vst, which is very easy to be achieved by using post-install script);
some resource files, default installed in /Library/Company/Xxxx_resources/.
And I want to allow users to change target directories of each compnent during installation.
I noticed there are two layers in PackageMaker: choice and package. When you drag an app/bundle/directory into PackageMaker, it will create a new choice and a new package. However, both choice and package layer contains Destination, which greatly confused me. In addition, in Components page for packages that is derived from an app or bundle, there is a check box labelled "Allow Relocation", which introduced further confusion.
I failed to find detailed information on those options. And after many attempts, I'm using the following layout and combination of options, that are very close to my target:
three choices and packages, each contain the app, the bundle, or the directory of resources.
in all choice layers, fill the Destination entry with actual default install paths, and select the "Allow alternate volume" checkbox;
in all package layers, fill the Destination entry with /, and select the "Allow custom location" checkbox;
in all Components page in package layers, deselect all Allow Relocation checkbox.
However, it still has a very weird behavior: the app is copied twice, to both its own directory, and overwriting the directory of the plugin bundle. If you "show content" on the installed bundle, it will look something like this:
/Library/Audio/Plug-Ins/VST/Xxxx.vst
|
+contents
|
+-info.plist: after looking on its content, it is actually the app's plist, not the bundle's
|
+-MacOS
| |
| +-Xxxx: the bundle's dynamic library, which is expected to be here
| |
| +-XxxxBin: the app's executable, which is NOT expected to be here
|
+-Resources
|
+-Xxxx.xml: some config info for the bundle, which is expected to be here
|
+-icon.icns: the app's icon, which is NOT expected to be here
I am quite exhausted on this stuff, but still not reaching my target that looks pretty simple: user-changeable install directory for multiple components. It's really appreciate for someone who can drag me out of this quagmire. Thanks for a lot!
Finally I found the actual cause is not in PackageMaker stuffs, but is inside the bundles being packaged. The bundle identifier of both the app and the plugin is empty. After I assign them with distinct values, everything just work fine.

silverstripe starting page in db level

silverstripe has main page, which after every rebuild is created new (as home page not always suits).
How and where can i see/change this after rebuilt in mysql level (table?).
I have looked however could not find place/table/field which denotes that this is "link of home page, etc."
Any help would be nice.
This is created based of requireDefaultRecords in SiteTree, this indicates that this can be stopped with a yml config (in _config/config.yml)
SiteTree:
'create_default_pages' : 'false'
In old and deprecated SilverStripe 2.4 you could define any page as homepage for a domain. However this was refactored to a module in 3.x and by default the page with URLSegment "home" is the default home page.
But you can install the functionality with the homepage for domain module, best using composer:
composer require silverstripe/homepagefordomain
which will add an input field to the cms where you can define that page as homepage for a specific domain.