I'm using wget to download an HTML page with all its requisites. I would like to know if is it possible to download the page requisites (css, images, scripts, etc) in a different folder than the html page.
For example, right now if the html page has a link like the following one:
<link href="/css/style.css" rel="stylesheet">
The result from wget folder structure looks like:
├── index.html
├── css
├── style.css
Is there any option to change the style's output folder name? Like so:
├── index.html
├── **another name**
├── style.css
Thank you so much!
Related
I'm following a Kevin Powell bootstrap tutorial and he copies a custom.scss file into a separate folder, however I can't find that file to copy, not sure if it's because I'm using an updated version of bootstrap.
the bootstrap documentation says after install of bootstrap via npm i should have a folder structure like this:
your-project/
├── scss
│ └── custom.scss
└── node_modules/
└── bootstrap
├── js
└── scss
However, upon installing bootstrap into folder it's like this:
your-project/
└── node_modules/
└── bootstrap
├── js
└── scss
No scss folder apart from in bootstrap folder.
Do I need to create a "custom.scss" file ...?
No you don't need to do that, as you could compile your css directly from the bootstrap source files. However, I would only consider this method if you plan use bootstrap out-of-the-box with no customizations, now or in the future. If you choose not to create this file, then you should probably just use a CDN instead.
Should you create a "custom.scss" file?
Yes, this is where you modify bootstrap variables, or extend its components, etc.. You can also choose to import all of bootstrap, or just the parts you need in this file.
The documentation goes over what should be in that file. But you can get started with just the following:
// Custom.scss
// Option A: Include all of Bootstrap
#import "node_modules/bootstrap/scss/bootstrap";
I'm generating a static website with Hugo.
Here's the structure of my content folder:
content/
└── post
├── post01
│ ├── image.xcf
│ ├── image.jpg
│ └── index.md
└── post02
├── image.xcf
├── image.jpg
└── index.md
Each of the posts has a .jpg files. These images are exported from my image editing program. To avoid confusion, I'm keeping the original working .xcf files from the image editing program in the same folder as the exported image, in case I need to edit an image in the future, and re-export it. But I don't want to publish those .xcf files to the server.
Is there a way to configure Hugo to exclude all files with .xcf extension when generating the static site?
Be aware that there's an open issue at GitHub that this feature might not work exactly as documented. It worked for me with Hugo 0.62.0 and your given directory and file structure.
As per the documentation, you can exclude content files with the ignoreFiles directive.
In your specific case, add the following to your config.toml (resp. YAML or JSON)
ignoreFiles = [ "\\.xcf$" ]
I'm trying to create a website using Jekyll, and everything worked fine. Until I wanted to custom the design.
I've updated my css/main.scss in order to include my custom theme in _sass/theme.scss:
// Import partials from `sass_dir` (defaults to `_sass`)
#import
"base",
"layout",
"syntax-highlighting",
"theme"
;
I've also updated _config.yml, because jekyll serve -H 0.0.0.0 didn't compile my new sass file. I've added the following:
sass:
sass_dir: _sass
The problem is jekyll serve doesn't compile my sass files, I always see the default css. I've also tried to copy the content of _sass/theme.scss directly at the end of css/main.scss, but nothing happened.
Until I modified one of those files while jekyll serve was running. The thing is jekyll-watch understands my updates and compile the scss files. May I have done something wrong for jekyll build don't compile sass files at the first try?
In case you need it, here my project tree:
.
├── _config.yml
├── css
│ ├── main.css
│ └── main.scss
├── _images
├── img
├── index.html
└── _sass
├── _base.scss
├── _layout.scss
├── _syntax-highlighting.scss
└── _theme.scss
Does someone know how to fix this?
Thank you,
Ok, I get it !
You have a css/main.css files that is copied as a static file in _site/css/main.css.
The problem is that it has the same name as the css/main.scss target which is also _site/css/main.css.
So at first build :
css/main.scss is processed to main.css
then, when static files are copied, it is overridden by css/main.css.
Solution : delete css/main.css
Have you added the front matter to the top of your main.scss file?
First add to your config.yml
sass:
sass_dir: _sass
Then add to top in your main.scss file, two dashed lines https://jekyllrb.com/docs/assets/
---
---
#charset "utf-8";
After that write in your cmd console
jekyll serve
and check your compilation.
I've run into similar issues when trying to use Jekyll to pass YAML content into partials. It looks like this workflow is not possible.
The work around was to place all variables on the main SCSS file and get Jekyll to populate the values from YAML, then using partials for the actual styles.
Here's a simple repo with some of my solutions: https://github.com/guschiavon/jekyllfy-sass
I am new to Magento 2...and trying to learn CODEPOOL in Magento 2. This is a very basic question regarding Magento 2 Folder Structure.Magento 2 is differ from other previous version like Magento 1.9.1,1.9.0 ...
Magento 2 is significantly different from Magento 1.X and s not backward compatible as well.
In Magento 2,
All Custom Modules will go in app/code
Module Name will be something similar to app/code/[Company]/[Module]
View of the module (layout XMLs, Template .phtmls, Module Javascripts, LESS, CSS and all related files) will now go inside the Module Folder itself, making the module is standalone and independant
No More codepools. Core team has written their own modules for functionalities and core code lives in [MAGE_ROOT]/vendor/magento/. for example Catalog Module is now at [MAGE_ROOT]/vendor/magento/module-catalog having the module name Magento_Catalog
Even the Magento themes are now coming as Modules, look for [MAGE_ROOT]/vendor/magento/theme-frontend-luma or [MAGE_ROOT]/vendor/magento/theme-adminhtml-backend
Usage of Advanced Design Patterns and Features like Namespaces, Automatic Dependancy Injection, Static Content Generation
Some Used Technologies
LESS, jQuery, RequireJS, knockout.js and More
Varnish, Redis, Memcached
Solr
A complete list as per the documentation http://devdocs.magento.com/guides/v2.0/architecture/tech-stack.html
Good Tutorials to Follow
http://alanstorm.com/
https://www.ashsmith.io/
Give it a try. It's complex, more advanced. But worth learning...
Magento 2 all module reside inside app/code folder.
Inside app/code folder
/etc (main configuration folder module.xml)
/Setup (database table related file)
/Controller(action file)
/Model(Business logic)
/Helper (Miscellaneous data)
/Block (Block Template function file)
/view (phtml and layout file with css and js file)
/i18n (For translation language feature)
There are no core/community/local folder and those all folders are remove.
Magento use complete MVC pattern as following:-
1.complete module code resides in single folder:VendorName/ModuleName
2.No core/community/local folder
3.complete front end data (view data) resides into view folder.
4.Module register trough registration.php file.
5.dependency manage by composer.js file.
Magento 2 code structure is different from Magento 1. Code can be found under [MagentoRoot]/app/code and can also be installed under [MagentoRoot]/vendor directory using composer. Frontend Themes can be created under [MagentoRoot]/app/design/frontend and Admin Themes can be created under [MagentoRoot]/app/design/adminhtml
As far as concerned with Magento 2, the code pool structure of Magento 2 is different than Magento 1.
There are directories of modules where code found in Magento 2 as:
app/code
vendor
design/frontend
design/adminhtml
Every module follows the directory structure as VendorName/ModuleName inside the directory app/code, all the Code can be found under [MagentoRoot]/app/code, and can similar third-party modules also can be installed under /vendor directory using composer.json.
Please check the complete documentation:
https://developer.adobe.com/commerce/php/development/build/component-file-structure/
https://www.cloudways.com/blog/create-module-in-magento-2/
magento extension folder structure :
In Magneto 2 very easy to understand folder structure
Common directories
Following are some common module directories:
Block: contains PHP view classes as part of Model View Controller(MVC) vertical implementation of module logic.
Controller: contains PHP controller classes as part of MVC vertical implementation of module logic.
etc: contains configuration files; in particular, module.xml, which is required.
Model: contains PHP model classes as part of MVC vertical implementation of module logic.
Setup: contains classes for module database structure and data setup which are invoked when installing or upgrading.
Additional directories
Additional folders can be added for configuration and other ancillary functions for items like plugin-ins, localization, and layout files.
Api: contains any PHP classes exposed to the API.
i18n: contains localization files.
Plugin: contains any needed plug-ins.
view: contains view files, including static view files, design templates, email templates, and layout files
Theme file structure
A typical theme file structure can look like the following:
├── composer.json ├── etc │ └── view.xml ├── i18n │ └── en_US.csv ├── LICENSE_AFL.txt ├── LICENSE.txt ├── media │ └── preview.jpg ├── registration.php └── web ├── css │ ├── email.less │ ├── print.less │ ├── source │ │ ├── _actions-toolbar.less │ │ ├── _breadcrumbs.less │ │ ├── _buttons.less │ │ ├── components │ │ │ └── _modals_extend.less │ │ ├── _icons.less │ │ ├── _layout.less │ │ ├── _theme.less │ │ ├── _tooltips.less │ │ ├── _typography.less │ │ └── _variables.less │ ├── _styles.less │ ├── styles-l.less │ └── styles-m.less ├── images │ └── logo.svg └── js ├── navigation-menu.js ├── responsive.js └── theme.js
Common directories
Typical theme directories are:
etc: Contains configuration files such as the view.xml file which contains image configurations for all images and thumbnails.
i18n: Translation dictionaries, if any.
media: Theme preview images (screen capture of your theme) can be put in here.
web: Optional directory that contains static files organized into the following subdirectories:
css/source: Contains a theme’s less configuration files that invoke mixins for global elements from the Magento UI library, and the theme.less file that overrides the default variables values.
css/source/lib: Contains view files that override the UI library files stored in lib/web/css/source/lib.
fonts: The folder to place the different fonts for your theme.
images: Static images folder.
js: The folder for your JavaScript files.
Base on this tutorial:
http://spring.io/guides/gs/serving-web-content/
I can use the thymeleaf to serve the view in the location
/src/main/resources/templates/
However, I have to put the static web contents (css, js) in another location:
/src/main/webapp/resources
And linking the resources in the hello.html like that:
<link href="resources/hello.css" />
<script src="resources/hello.js"></script>
The directory structure is:
└── src
└── main
└── java
└── hello.java
└──resources
└──templates
└──hello.html
└──webapp
└──resources
└──hello.js
└──hello.css
The problem is that the links of the static files are work when I run the web server. But if I open the html files in offline mode, the links are broken.
Could I move the static resource from
/src/main/webapp/resources
to:
/src/main/resources/templates/resources
The new directory structure would be like:
└── src
└── main
└── java
└── hello.java
└──resources
└──templates
└──hello.html
└──resources
└──hello.js
└──hello.css
I tried it but is doesn't work.
Try src/main/resources/static (or src/main/resources/public or src/main/resources/resources). All those are registered by Spring Boot autoconfig.
Define the mapping in your context like following -
<mvc:resources mapping="/templates/**"
location="classpath:/templates/" />
This will route everything that's hitting /template/ url to search for contents under your src/main/resources/templates/ folder.
In case you need tweaking in the url/prefix - adjust the mapping accordingly.