I am running at blogdown site from this github repo hosted by Netlify at https://timmastny.rbind.io/
In website2/content/blog/ I have two posts
2018-01-16-git-blogdown-project-workflow.Rmd
and
2018-01-13-bayesian-meta-analysis-powerlifting.Rmd
You can see that in the YAML of both posts, I have draft: true and in the second one I even have publishdate: '2018-01-20' which is in the future as of this post.
However, with these changes pushed to github and Netlify deployed with a clean cache, on my actual website I still see the posts:
https://timmastny.rbind.io/
What am I missing about draft: true?
I've read sections 2.3.1 and D.3 of the books, but I'm not sure. I've also updated Hugo to 0.32.4 and am on the latest version of blogdown.
Edit: I've deleted the public folder and added public to gitignore. Netlify had a 16 minute build which was published. But on the actual website I get a Page Not Found error.
Here's the log: https://app.netlify.com/sites/timmastny/deploys/5a60c299df99532a0147c3d7
Here's my deploy settings on Netlify. They should match the suggestions in 3.1 of the blogdown book:
Deploy settings
Repository: https://github.com/tmastny/website2
Build command: hugo
Publish directory: public
Production branch: master
Branch deploys: Deploy only the production branch and its deploy previews
Public deploy logs: Logs are public
Build environment variables:
HUGO_VERSION 0.32.4
I am going to assume you are using public as your deploy folder for Netlify.
Issue #1
Your public folder is in your repository, so it is checked out to the Netlify site and when you run your build your posts already exist in that folder, so they are always going to be deployed.
Solution #1
Delete the public folder from your project and add a .gitignore for the public folder.
The deploy should build the public folder fresh on each deploy, so it can compare the CDN with your build and copy the correct files only.
Issue #2 (updated question)
The Hugo theme is set to theme = "hugo-xmin" in the config.toml. When checking out the repository from GitHub, this theme folder is empty. It would be empty on Netlify as well, so the build becomes invalid.
Solution #2
Changed to a valid theme theme = "hugo-lithium-theme" in the config.toml and the build starts to create your site pages.
Original Issue
When updating draft: true in .Rmd does not ignore on build.
Solution (for Original)
Hugo is not processing your content for .Rmd, it is using your content from the processed .html files created. So you need to make sure you are committing the content for those files with draft: true in them to your repository before a build.
Related
I have a static website built with Next.js and currently deployed in GitHub Pages. I already have a custom 404 page created in Next.js with a config trailingSlash: true which puts it under this directory /404/index.html. In GitHub Pages' documentation here and saw that I can use 404.md which can read permalink, I assume this means the path to my custom 404 page. So I created one in the root folder of my deployment branch.
---
permalink: /404/index.html
---
But it didn't seem to work. I was wondering if there's something I've assumed or done wrong. Do also note that my GitHub Pages is already under a custom domain. Please suggest if there's another way but still keep the trailingSlash: true config because I don't want to show .html on the route of my other static pages. Thank you in advanced.
In the end, instead of using 404.md, I just added a step in my ci/cd GitHub Actions workflow to move the generated 404 page and rename it to 404.html which GitHub Pages will understand as my custom 404 page.
jobs:
build:
...
steps:
...
- name: Generate static files
run: yarn export
- name: Move 404 page to root directory
run: mv ./out/404/index.html ./out/404.html
I am trying to create a new blogdown project, and I've been using Yihui Xie's wonderful documentation to get started.
This works as expected:
Wen I run the below code, I see a live representation of the demo page, and the public folder is generated in my local directory.
library(blogdown)
blogdown::new_site(theme = "gcushen/hugo-academic")
blogdown::build_site()
blogdown::serve_site()
This does not work as expected:
But when I re-run using the "gesquive/slate" theme, I see a live representation of the demo page as expected, but no public folder is generated in my local directory. Without a public folder, I have nothing to send to Netlify.
library(blogdown)
blogdown::new_site(theme = "gesquive/slate")
blogdown::build_site()
blogdown::serve_site()
Why is a public folder generated when I use any Hugo theme other than "gesquive/slate"?
I expect that I'm misunderstanding something about how the package works with Hugo.
Look at the theme config.toml, the published folder (publishDir) is "docs", you can rename it to "public" if you wish.
Step 1: I create a new repository on my github and save the link:
Step 2: I create a new project
File -> Create Project -> Version Control -> Git
Fill in the details:
Repository URL: Taken from the new repository on my github
Project directory name: USER.github.io
Create project as subdirectory of: ~
Step 3: I create the blogdown website on my RStudio desktop
install.packages("blogdown")
blogdown::new_site(theme = "gcushen/hugo-academic")
Step 4: I use blogdown::build_site() to build the site where I can access it here http://127.0.0.1:4321/. I also run blogdown::serve_site().
Step 5: I now want to upload these files to my github
So in RStudio I select git -> Shell. I run the following:
git add -A
git commit -m "commit operation"
git push --force
Now I have all my files uploaded to github. I can make the modifications to the R markdown files in my RStudio and push them to github.
Based on the steps I have stated, where am I going wrong?
I go to my github repository and click settings, scroll down to github pages and see:
Your site is having problems building: Unable to build page. Please
try again later.
EDIT:
I added a URL to the github pages section in settings
Source Your GitHub Pages site is currently being built from the master
branch.
So that works, but when I go to my website link or github page USER.github.io I get a 404 Site not found message.
EDIT: I think it is something to do witht he public folder and that I should only push to github this public folder or set the website to only read this public folder.
On github it stats User pages must be built from the master branch. - which I think the master branch is unreadable.
https://sourcethemes.com/academic/docs/deployment/
I uploaded my website simply by copying the home directory and drop it in the netlify. However, I edited the .toml file as explained here to include on top of it the following 2 parameters:
relativeurls = true
canonifyurls = false
It is now working perfectly.
I am trying to install silverstripe, downloaded the zip file, unzipped and copied all the files into the root of a folder in MAMP.
When I go to the root location in the url, in goes to install.php, but shows no styling whatsoever. But in the console no issues.
In this way I can't even install silverstripe because it isn't doing anything.
Any help would be appreciated.
SS 4.1 now uses a sub folder called public as root for your site. You will need to change the Document root to the public folder, and then move some files and folders into the public folder as described in the install docs.
htaccess
assets - folder
resources - folder
index
install
web.config
favicon
install-frameworkmissing
Most important run the following in composer
composer vendor-expose
So I have a cap file linked to my github and setup to deploy my project to my server. When I run
bundle exec cap prod deploy it all works without a hitch.
I can see my code being cloned from my repo, a new release folder is created and symlinked to the current folder. However any changes I've made to my code aren't reflected.
The repo being cloned is a fork of the original repo which I created when I began working on the project. I haven't made any changes to code base except adding a single line to a twig file.
I have updated the deploy.rb so that it pulls from my forked repo instead of the original one and can see the code change in my latest commit. However the change is not reflected on the site.
Any ideas why this might be happening?
Cheers
Two possibilities come to mind other than using the incorrect URL to the forked git repository -
I occasionally try to deploy a new copy of my own site, but I have not yet pushed the latest code from my development server (and the local repo) to the live repo on Github, but it is from Github that the code is being fetched from during deployment.
As a final step, Capistrano changes the location that the 'current' symlink points to the newly deployed directory in the 'releases' directory. Your webserver (apache or Nginx must be set to use the 'current' symlink) as part of the base directory (it will probably be ..../current/web/, and then auto-load app.php from that directory, unless there a subdirectory/file exists, for .CSS/JS/images/etc). If the webserver config refers to the 'release' directory, and not the symlink, it will only be a specific, older, deployment.