Article directory
🌈【Ultimate Tutorial】JekyllCheats for multi-website configuration, enjoy accessing different web addresses and enjoyunlimitedpleasure! ✨🎈
🌈 Want to easily master Jekyll multi-site configuration skills? here hasBuild a static blog website from scratch on your local computerThe ultimate tutorial! From setting up different website access to enjoying unlimited fun, this guide will do it all! Let you become a website master! 💥🚀
Jekyll multiple static website configuration methods
edit _config.yml file to configure Jekyll.
Configuration items include site title, description, theme, URL, etc...
When using Jekyll to build multiple websites locally, you can access different websites in the following ways:
Use a different port number:
- Each website can run on a different port number.
- For example, you can run your personal blog on the port
4001on, run the project display website on the port4002on. - In a browser, you can access different websites by specifying the port number in the URL.
- For example, to access the port running
4001On your personal blog, you can enterhttp://localhost:4001.
Here are some specific configuration examples:
Use a different port number:
# _config.yml 文件
port: 4001
Use a different domain name:
# _config.yml 文件
url: "http:// blog.example. com"
Manage multiple Jekyll static websites

You can create a separate folder for each website, customizing each website with different profiles and content.
Example: Let's say you want to create a personal blog and a project showcase website.
personal blog:
- Create a file called
blogfolder. - On
blogfolder, create_config.yml和index.mdfile. - On
_config.ymlIn the file, configure the site title, description, etc... - On
_postsfolder, add your blog post.
Project display website:
- Create a file called
portfoliofolder. - On
portfoliofolder, create_config.yml和index.mdfile. - On
_config.ymlIn the file, configure the site title, description, etc... - On
_postsfolder, add your project information.
Publishing website:
- On
blogfolder, runjekyll serveOrder to publish a personal blog. - On
portfoliofolder, runjekyll serveCommand release project display website. - Using Jekyll to build multiple websites is a simple and effective way.
How to start a locally installed Jekyll website through a command?
To be launched via command line installed locally d:\Jekyll\site1\ For the Jekyll website, you can follow these steps:
1. Navigate to the Jekyll website folder:
- Open a command line or terminal.
- Navigate to the website folder using the command
cd /d d:\Jekyll\site1
2. Run the jekyll serve command:
bundle exec jekyll serve
- This command will start the Jekyll server and start hosting your website locally.
3. You can view your website by accessing the following URL in your browser:
http://localhost:4001
Here are some additional tips:
- you can use
--portoption specifies the port number. For example, to host your website on port8080, please run the following command:
bundle exec jekyll serve --port 8080
- you can use
--configOptions specify the configuration file. For example, to use a file namedmyconfig.ymlconfiguration file, run the following command:
bundle exec jekyll serve --config myconfig.yml
- transfer
--livereloadoptions toserveAutomatically refresh the page every time a change is made to a source file:
bundle exec jekyll serve --livereload
- Deploy your website using the following command:
bundle exec jekyll build
How to add article content in Jekyll?
Create a .md file to add content.
Jekyll support Markdown Grammar, which can be used to format text, insert images, create links, etc...
By following the tutorial below, you should be able to quickly create a website that suits your needs▼
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Jekyll builds multiple static websites locally. How to configure the URLs for accessing different local websites?" 》, helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-31561.html
To unlock more hidden tricks🔑, welcome to join our Telegram channel!
If you like it, please share and like it! Your sharing and likes are our continuous motivation!
