I am trying to convert a ghost website running on localhost:2368. I am using buster, which uses wget to download files from localhost:2368 and turn it into a static website. My problem is that wget makes all links with reference as localhost:2368.
<link rel="stylesheet" type="text/css"
href="http://localhost:2368/assets/styles/style.css">
I have identified the buster code that calls wget when generating the static website:
if arguments['generate']:
command = ("wget "
"--recursive " # follow links to download entire site
"--convert-links " # make links relative
"--page-requisites " # grab everything: css / inlined images
"--no-parent " # don't go to parent level
"--directory-prefix {1} " # download contents to static/ folder
"--no-host-directories " # don't create domain named folder
"--restrict-file-name=unix " # don't escape query string
"{0}").format(arguments['--domain'], static_path)
I use py -m buster generate --domain=localhost:2368 to generate the website. Is there any way for me to generate these files with references to my website? example instead of localhost:2368 it should be abc.com.
There were two issues with the buster GitHub repo that didn't account for this. I found a pulled repo with some fixes and another very specific pull request on the original repo. Merging the pull request with the files from the pulled request helped fix this issue for me. For those interested in a working buster repo for Ghost Static Pages Please refer below:
Refer to this pull request This pull request fixes the css versioning issue for Windows.
And this working GitHub Repo to see the issues that were fixed. This fix allowed us to pass in --new-domain option which is used to create links.
Apparently, the existing repo is no longer supported.
Related
I am running Windows 10 with GitHub Desktop. I installed Jekyll and tried to create a test blog.
I started with the instructions at:
https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll
I created the repository in GitHub Desktop and immediately published it to Github.com.
When I use GitHub Desktop to "open in bash" as mentioned in the link above, I get sent to:
E:\codingPractice\DocSourceBlog\DocSourceBlog>
Following the suggestions in the link above, I enter:
E:\codingPractice\DocSourceBlog\DocSourceBlog>mkdir docs
E:\codingPractice\DocSourceBlog\DocSourceBlog>cd docs
E:\codingPractice\DocSourceBlog\DocSourceBlog\docs>git checkout --orphan gh-pages
I enter $ jekyll new . and I get
New jekyll site installed in E:/codingPractice/DocSourceBlog/DocSourceBlog/docs.
I edit the gemfile, comment out the "gem jekyll" and change the next line to
gem "github-pages", "~> 214", group: :jekyll_plugins
by substituting the current version number into the boilerplate of the above link.
I run bundle update and bundle exec jekyll serve and localhost:4000 shows the expected site, including a sample blog post that can be accessed by clicking "Welcome of Jekyll!" That sample blog post starts off with:
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways,
I use GitHub Desktop to commit the changed files to the branch and publish the branch to GitHub.
I refer to instructions at:
https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source
I go to github.com/longarchivist/DocSourceBlog/settings/pages and set the source to "gh-pages" and "docs"
I go to https://longarchivist.github.io/DocSourceBlog/ and see that some of the content is there, but the blog post does not seem to show up as expected at "Welcome to Jekyll!" I click the link and get to
https://longarchivist.github.io/jekyll/update/2021/04/18/welcome-to-jekyll.html
but that has the 404 page.
I check the github web interface to make sure that the "_posts" directory is there.
I noticed that the address of the "Welcome to Jekyll!" link was:
http://localhost:4000/jekyll/update/2021/04/18/welcome-to-jekyll.html
I can speculate that ruby somehow destroyed the correct Jekyll configuration when I tried bundle exec jekyll serve but if that was enough to break the system then the documentation seems to be badly misleading.
I tried editing the config file. The "baseurl" variable is now "/docs" and the link address is
https://longarchivist.github.io/docs/jekyll/update/2021/04/18/welcome-to-jekyll.html
However, the desired sample blog post still does not display. Instead
https://longarchivist.github.io/docs/jekyll/update/2021/04/18/welcome-to-jekyll.html
is still a 404 page.
So the localhost problem is not the key to the problem.
Any constructive criticisms would be appreciated.
The best way seems to be to start a root directory that must contain your username first, then start a separate project directory for each project.
After creating a project directory, use "jekyll build" to auto-generate a Jekyll site. Add posts manually in the posts directory: somehow the index finds them automatically.
Then go back to the root site and manually add a link to your project directory.
For example:
https://longarchivist.github.io/
links to
https://longarchivist.github.io/codediary/
which currently has two posts. I created the second post by copying the original, then renaming it. Jekyll apparently expects the post filename to have the correct day and month, so when I use this tactic in the future, I will have to update those manually.
I want to learn how to use rawgit.com to serve other applications from github.com.
So we have a usual way to download and install homebrew on osx.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I can't find the install file on GitHub. Where is it?
The raw.githubusercontent.com domain is used to serve unprocessed versions of files stored in GitHub repositories. If you browse to a file on GitHub and then click the Raw link, that's where you'll go.
The URL in your question references the install file in the master branch of the Homebrew/install repository. The rest of that command just retrieves the file and runs ruby on its contents.
There are two ways of looking at github content, the "raw" way and the "Web page" way.
raw.githubusercontent.com returns the raw content of files stored in github, so they can be downloaded simply to your computer. For example, if the page represents a ruby install script, then you will get a ruby install script that your ruby installation will understand.
If you instead download the file using the github.com link, you will actually be downloading a web page with buttons and comments and which displays your wanted script in the middle -- it's what you want to give to your web browser to get a nice page to look at, but for the computer, it is not a script that can be executed or code that can be compiled, but a web page to be displayed. That web page has a button called Raw that sends you to the corresponding content on raw.githubusercontent.com.
To see the content of raw.githubusercontent.com/${user}/${repo}/${branch}/${path} in the usual github interface:
you replace raw.githubusercontent.com with plain github.com
AND you insert "blob" between the repo name and the branch name.
In this case, the user is "Homebrew", the repo is "install", the branch name is "master" (which is a very common branch name). You insert "blob" between "install" and "master", so
https://raw.githubusercontent.com/Homebrew/install/master/install
becomes
https://github.com/Homebrew/install/blob/master/install
This is the reverse of finding a file on Github and clicking the Raw link.
raw.githubusercontent.com/username/repo-name/branch-name/path
Replace username with the username of the user that created the repo.
Replace repo-name with the name of the repo.
Replace branch-name with the name of the branch.
Replace path with the path to the file.
To reverse to go to GitHub.com:
GitHub.com/username/repo-name/directory-path/blob/branch-name/filename
I am using github pages + jekyll to establish my blog.
It worked properly before pushed my latest commit. This commit adds a cname file and just edits some words without any alterations over the architecture of my site.
- <h3 class="description">aaaaaaaaaa</h3>
+ <h3 class="description">bbbbbbbbbb</h3>
After that markdown does not appear properly.
When I write #head1. It does not appear title head1, it just appears #head1 directly.
However, if I use jekyll serve build in localhost:4000, it appears correctly.
This is my _config.yml:
markdown: kramdown
markdown_ext: markdown,mkd,mkdn,md
textile_ext: textile
highlighter: pygments
Any ideas what has been causing this error?
UPDATED!
This is most likely due to Jekyll 3 upgrade on GitHub Pages.
From May 1st 2016 on, GitHub will not support rdiscount nor redcarpet anymore. Also, since February 1st, GitHub Pages only supports rouge:
Starting May 1st, 2016, GitHub Pages will only support kramdown,
Jekyll's default Markdown engine.
GitHub Pages now only supports
Rouge.
You can check this out here.
In order to deal with it, proceed as the following:
First, try as explained on this answer. Instead of #Heading you'll write # Heading.
Second, adjust your _config.yml: change highlighter and markdown for
highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
Third, to build your site locally, use Bundler, the method recommended by GitHub:
Install Bundler:
gem install bundler
Then run bundle update - this will update all your gems, including github-pages, if you already have this gem installed locally.
Then, create a Gemfile (leave it without any file extension) with the following content:
source 'https://rubygems.org'
gem 'github-pages'
Save it to your project's root.
Then, run bundle install on your project. This will create a file called Gemfile.lock and will install all required gems and their dependencies.
Finally, run bundle exec jekyll serve --watch and you'll be able to view your website locally exactly as you'll view online (when hosting on GitHub).
You should be OK by then!
PS. If your project needs more gems, as jekyll-paginate or jekyll-mentions, you'll need to add them to the Gemfile, for example:
source 'https://rubygems.org'
gem 'github-pages'
gem 'jekyll-paginate'
Also, add them to your project's _config.yml:
gems:
- jekyll-paginate
- jekyll-mentions
Here you'll see a list of gem versions currently supported by GitHub Pages. Here you read about Upgrading Jekyll 2 to 3.
Hope to have helped!
A slight observation running my own Jekyll powered github pages blog,
A space between the # representing the heading size, and the heading text is important otherwise the markdown will not display as intended. Therefore with your example, I would display my markdown heading as,
# Zookeeper Atomic Broadcast for heading 1
## Zookeeper Atomic Broadcast for heading 2
### Zookeeper Atomic Broadcast for heading 3
#### Zookeeper Atomic Broadcast for heading 4
##### Zookeeper Atomic Broadcast for heading 5
GitHub support markdown as well jekyll.
First of all rename your file with the .md extension
If you have .nojekyll in your folder it will disable njekyll.
Verify that you don't have this is your folder.
Read the docs && GitHub relevant doc on how to prepare and deploy
Running Jekyll
Use the command git checkout to switch to the default branch that the GitHub Pages build server uses to generate your site. The default branch you switch to depends on the type of GitHub Pages site you're building.
For Project Pages sites, switch to gh-pages.
For User Pages or Organization Pages sites, switch to master. For more information, see "User, Organization, and Project Pages".
Use the command bundle exec jekyll serve in the root of your repository to run the GitHub Pages build server with Bundler.
bundle exec jekyll serve
Navigate to http://localhost:4000 to see your local site.
I've created my own gitbook. looks good locally.
but how shall I integrate it into my github pages? Similar issues here difficulty-in-getting-gitbook-site-to-show-up-in-github-page
I tried that approach as well, but I have problem setting the grunt up, and I also I would like to do that myself before using an integrated tool.
I tried to copy the generated _book folder to my github page folder, but that didn't workout as there are some encoding issues
Similar question here
I had this question because I don't understand github pages, the underlying steps involve
build the _book folder, this is the static content that will be served
create gh-pages branch copy the _book folder content into gh-pages
github will then serve the content
the command gitbook publish will finish all 3 steps. but I am not familiar with grunt as well , as npm install . is a pre-step.
I created a "jekyll new xx" site locally. When I run Jekyll serve it works very nicely.
Now, I create a new github repo and a branch gh-pages: https://github.com/pitosalas/deleteme
However when it is rendered as a github page it looks all wrong, like style sheets and other assets are missing.
Update
Steven Perry: Thanks for your response, but I had a typo. I wanted to point to the github repo containing the Jekyll "input" files which are then regenerated into the stuff that is served to the browser. The extra slash in the CSS file is an excellent clue but it is in a file generated by Jekyll I think. I can't edit it directly I need to figure out how to get Jekyll to generate it correctly. Do you know?
<link rel="stylesheet" href="/css/syntax.css">
<!-- ^
/
remove this slash ---
-->
Example
For more info, your problem file is here
default.html