This commit is contained in:
WickedJack99
2022-09-21 15:42:06 +02:00
parent e5ab4f2c99
commit c08b4b2014
3 changed files with 26 additions and 11 deletions

View File

@@ -76,8 +76,9 @@
<i>gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins</i><br>
You can find the actual version of GitHub-pages <a href="https://rubygems.org/gems/github-pages" target="_blank">here</a>.<br>
Now save and close the Gemfile.<br>
<br>
</div>
<div>
<h3>Install bundle</h3>
Now still being at the localDev-directory, install the bundle:<br>
<div class="console">
<code>$ bundle install</code><br>
@@ -98,9 +99,13 @@
<code>$ JEKYLL_ENV=production bundle exec jekyll build</code>
</div>
Your Jekyll-project was now build and stored at _site.<br>
Clear your docs-directory:
<div class="console">
<code>$ rm -r ../docs/*</code>
</div>
Now move the content of the localDev/_site to docs:<br>
<div class="console">
<code>$ cp -r _site/* ../docs</code><br>
<code>$ cp -r _site/* ../docs</code>
</div>
And push your changes to your central GitHub-Repository.
</div>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2022-09-21T15:34:38+02:00</updated><id>/feed.xml</id><title type="html">Mr.</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">2022 Week 38 How to create a static website with Jekyll and deploy it on GitHubPages</title><link href="/2022/09/20/how-to-create-githubpage.html" rel="alternate" type="text/html" title="2022 Week 38 How to create a static website with Jekyll and deploy it on GitHubPages" /><published>2022-09-20T00:00:00+02:00</published><updated>2022-09-20T00:00:00+02:00</updated><id>/2022/09/20/how-to-create-githubpage</id><content type="html" xml:base="/2022/09/20/how-to-create-githubpage.html">&lt;div class=&quot;outerDiv&quot;&gt;
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2022-09-21T15:41:50+02:00</updated><id>/feed.xml</id><title type="html">Mr.</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">2022 Week 38 How to create a static website with Jekyll and deploy it on GitHubPages</title><link href="/2022/09/20/how-to-create-githubpage.html" rel="alternate" type="text/html" title="2022 Week 38 How to create a static website with Jekyll and deploy it on GitHubPages" /><published>2022-09-20T00:00:00+02:00</published><updated>2022-09-20T00:00:00+02:00</updated><id>/2022/09/20/how-to-create-githubpage</id><content type="html" xml:base="/2022/09/20/how-to-create-githubpage.html">&lt;div class=&quot;outerDiv&quot;&gt;
&lt;div id=&quot;prerequisits&quot;&gt;
&lt;h3&gt;Prerequisits&lt;/h3&gt;
Install &lt;a href=&quot;https://git-scm.com/downloads&quot; target=&quot;_blank&quot;&gt;Git&lt;/a&gt;&lt;br&gt;
@@ -57,8 +57,9 @@
&lt;i&gt;gem &quot;github-pages&quot;, &quot;~&gt; GITHUB-PAGES-VERSION&quot;, group: :jekyll_plugins&lt;/i&gt;&lt;br&gt;
You can find the actual version of GitHub-pages &lt;a href=&quot;https://rubygems.org/gems/github-pages&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br&gt;
Now save and close the Gemfile.&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h3&gt;Install bundle&lt;/h3&gt;
Now still being at the localDev-directory, install the bundle:&lt;br&gt;
&lt;div class=&quot;console&quot;&gt;
&lt;code&gt;$ bundle install&lt;/code&gt;&lt;br&gt;
@@ -79,9 +80,13 @@
&lt;code&gt;$ JEKYLL_ENV=production bundle exec jekyll build&lt;/code&gt;
&lt;/div&gt;
Your Jekyll-project was now build and stored at _site.&lt;br&gt;
Clear your docs-directory:
&lt;div class=&quot;console&quot;&gt;
&lt;code&gt;$ rm -r ../docs/*&lt;/code&gt;
&lt;/div&gt;
Now move the content of the localDev/_site to docs:&lt;br&gt;
&lt;div class=&quot;console&quot;&gt;
&lt;code&gt;$ cp -r _site/* ../docs&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ cp -r _site/* ../docs&lt;/code&gt;
&lt;/div&gt;
And push your changes to your central GitHub-Repository.
&lt;/div&gt;
@@ -107,4 +112,4 @@
&lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/step-by-step/10-deployment/&quot; target=&quot;_blank&quot;&gt;https://jekyllrb.com/docs/step-by-step/10-deployment/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><author><name>Aaron</name></author><summary type="html">Prerequisits Install Git Install Ruby Install Jekyll and Bundler $ gem install jekyll bundler GitHub Create a GitHub-account Create a repository on GitHub (It has to be public if you use GitHub Free, note that your code will be visible to everyone!) Local Repository Clone the repository to a local directory: ssh $ git clone --recursive SSH_URL https $ git -c http.sslVerify=false clone --recursive HTTPS_URL Directories Create two directories: docs and localDev. $ mkdir docs $ mkdir localDev docs will contain the content of the website later on. localDev will contain our Jekyll project. Create Jekyll Project Move to the localDev-directory: $ cd localDev Create a new Jekyll-project at localDev-directory: $ jekyll new --skip-bundle . (make sure you got the dot) Edit Gemfile Open the Gemfile that Jekyll created and comment out (#) the line which starts with gem &quot;jekyll&quot; Add the github-pages gem by editing the line starting with # gem &quot;github-pages&quot;. Change this line (# gem &quot;github-pages&quot;) to: gem &quot;github-pages&quot;, &quot;~&gt; GITHUB-PAGES-VERSION&quot;, group: :jekyll_plugins You can find the actual version of GitHub-pages here. Now save and close the Gemfile.</summary></entry></feed>
&lt;/div&gt;</content><author><name>Aaron</name></author><summary type="html">Prerequisits Install Git Install Ruby Install Jekyll and Bundler $ gem install jekyll bundler GitHub Create a GitHub-account Create a repository on GitHub (It has to be public if you use GitHub Free, note that your code will be visible to everyone!) Local Repository Clone the repository to a local directory: ssh $ git clone --recursive SSH_URL https $ git -c http.sslVerify=false clone --recursive HTTPS_URL Directories Create two directories: docs and localDev. $ mkdir docs $ mkdir localDev docs will contain the content of the website later on. localDev will contain our Jekyll project. Create Jekyll Project Move to the localDev-directory: $ cd localDev Create a new Jekyll-project at localDev-directory: $ jekyll new --skip-bundle . (make sure you got the dot) Edit Gemfile Open the Gemfile that Jekyll created and comment out (#) the line which starts with gem &quot;jekyll&quot; Add the github-pages gem by editing the line starting with # gem &quot;github-pages&quot;. Change this line (# gem &quot;github-pages&quot;) to: gem &quot;github-pages&quot;, &quot;~&gt; GITHUB-PAGES-VERSION&quot;, group: :jekyll_plugins You can find the actual version of GitHub-pages here. Now save and close the Gemfile. Install bundle Now still being at the localDev-directory, install the bundle: $ bundle install Optionally you can make changes at the _config.yml file. Learn Jekyll Follow this guide to learn Jekyll. Make sure that all files and directories you create are in the localDev-directory. Note that building locally will not work according to commenting out gem &quot;Jekyll&quot; at the Gemfile. (Atm I didn&apos;t check if this is right) If it is, you have to not comment it out and do bundle install again. Afterwards you can test locally with jekyll serve. Build Project After creating all necessary files and dirs, you can make a production build: Note that all files at _site will be cleared! $ JEKYLL_ENV=production bundle exec jekyll build Your Jekyll-project was now build and stored at _site. Clear your docs-directory: $ rm -r ../docs/* Now move the content of the localDev/_site to docs: $ cp -r _site/* ../docs And push your changes to your central GitHub-Repository. Publish Website Now publish your repository on GitHub Pages. Select your branch and as folder /docs and hit Save. Now you have to wait, this can take up to 10 minutes. On the top of the page a box will appear with the url of your website. Happy developing! Sources https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll https://docs.github.com/en/pages/quickstart https://docs.github.com/en/get-started/quickstart/set-up-git https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll https://jekyllrb.com/docs/structure/ https://jekyllrb.com/docs/step-by-step/01-setup/ https://jekyllrb.com/docs/step-by-step/10-deployment/</summary></entry></feed>