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.
Related
I want to deploy a Hugo-based website made using the blogdown package in Github Pages, while keeping the R source code of the website in the same repository. This should be achievable by generating the website files in the docs directory in the Github repository, and then pointing Github Pages to the docs folder in the main branch. However, I could not make it work.
Here, I describe a simple blogdown site to demonstrate the problem. The directory is created using Rstudio with the options as shown in the following picture.
I have edited the config.toml file, in particular to set the publishDir as docs and add a logo to the website. The content of the edited config.toml file is given below.
baseurl = "/"
publishDir = "docs"
languageCode = "en-us"
title = "Blogdown website in Github Pages"
theme = "hugo-lithium"
googleAnalytics = ""
disqusShortname = ""
ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
[permalinks]
post = "/:year/:month/:day/:slug/"
[[menu.main]]
name = "About"
url = "/about/"
[params]
description = "Demonstrating problem in deploying a blogdown website in Github Pages."
# options for highlight.js (version, additional languages, and theme)
highlightjsVersion = "9.12.0"
highlightjsCDN = "//cdnjs.cloudflare.com/ajax/libs"
highlightjsLang = ["r", "yaml"]
highlightjsTheme = "github"
MathJaxCDN = "//cdnjs.cloudflare.com/ajax/libs"
MathJaxVersion = "2.7.5"
[params.logo]
url = "logo.png"
width = 50
height = 50
alt = "Logo"
I have also edited the value of the publish parameter in the netlify.toml file to docs. I have done this to have the option to deploy the website using Netlify apart from Github Pages. The content of the edited netlify.toml file is:
[build]
command = 'hugo'
publish = 'docs'
[build.environment]
HUGO_VERSION = '0.89.4'
[context]
[context.branch-deploy]
command = 'hugo -F -b $DEPLOY_PRIME_URL'
[context.deploy-preview]
command = 'hugo -F -b $DEPLOY_PRIME_URL'
[context.production]
[context.production.environment]
HUGO_ENV = 'production'
Content of the website is added in the content folder, which includes an about.md file and a sample post 2021-12-09-sample-post.Rmd. The structure of the content folder is:
content
|-- about.md
|-- post
|-- 2021-12-09-sample-post.Rmd
The logo is added by placing the file logo.png in the static\images directory. The source code of this example can be downloaded from here. The local build in RStudio runs perfectly well. The files after building the website locally are uploaded here. I have placed the .nojekyll file in both the main directory and the docs folder to prevent Github Pages from using Jekyll.
However, the generated Github Pages site does not work. But it works perfectly in Netlify.
I have also tried changing the value of the baseurl argument in the file config.toml to point to the Github hosting directory. The website is generated perfectly in RStudio through blogdown. The source code as well as the generated website files are uploaded here. But now, neither Github Pages nor Netlify correctly deploys the website.
I wish to be able to deploy the website in both Github Pages and Netlify, just like which can be done for a website generated using the bookdown package in R. If that is not possible at all, I wish to be able to deploy the website in Github Pages at least. I wonder what mistakes I am making in the website code or configuration.
Short answer: set relativeURLs = true in config.toml, so that your pages use relative URLs (but this is really up to the theme's support for relative URLs; the hugo-lithium theme should be good).
Longer answer:
Your Github Pages URL https://joydeepchowdhury.github.io/deploymentproblem/ contains a subpath deploymentproblem/, whereas your Netlify URL does not: https://deploymentproblem.netlify.app/. If you don't use relative URLs, resources won't be correctly loaded on one of these two sites, e.g., /images/logo.png on https://joydeepchowdhury.github.io/deploymentproblem/ means https://joydeepchowdhury.github.io/images/logo.png, which is wrong (should have been https://joydeepchowdhury.github.io/deploymentproblem/images/logo.png instead), but it is correct on the Netlify site: https://deploymentproblem.netlify.app/images/logo.png. Absolute/relative URLs are tricky but extremely important to understand. You may read the last part of the Appendix B.1 of the blogdown book.
Another solution is to specify different baseURLs for different sites. For example, you may configure
baseURL: "https://joydeepchowdhury.github.io/deploymentproblem/"
in config.toml, but override it in netlify.toml:
[build]
command = 'hugo -b https://deploymentproblem.netlify.app/'
I cloned this repo to start my own project
https://github.com/invertase/react-native-firebase-starter
I have made some modifications and got it setup for Firebase, however I cannot push or rename the Repository.
I ran npm run rename and renamed the directory. GitHub still seems to think I am trying to push the orginal repository as my own.
When I try to push I get:
Authentication failed. You may not have permission to access the repository or the repository may have been archived...
How can I keep this template/starter and push a copy of it as my own repository?
I have tried removing all of the inessential files from the Repo and pushing that way. I get the following error:
I expected to be able to use the starter as a starter to get a project up and running... Maybe I am missing something super obvious.
I don't see a .git folder within the root of the react-native-firebase-starter template, perhaps this is causing issues with pushing this template since git needs to know where to point to upstream.
Maybe you could try initializing the template to your personal git repository and seeing if this resolves your authentication issue:
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files.
Initialize the local directory containing the template as a Git repository:
git init
Add the files in your new local repository. This stages them for the first commit:
git add .
Commit the files that you've staged in your local repository:
git commit -m "Initial commit"
At the top of your GitHub repository ,created in step 1, copy the remote repository URL.
Add the URL for the remote repository where your local repository will be pushed:
git remote add origin <remote_repository_url>
Push the changes in your local repository to your upstream repository contained in GitHub:
git push -u origin master
You should now be able to push this starter template into your own GitHub repository and use it as your own project.
As for the npm run rename command: this is a custom npm run script created by the author of this starter template and it simply runs the rename.js file contained within the .bin directory of the template's root directory. All this command does is recursively rename the files contained within this template project to the new name specified by your input, so I don't think this is causing the issue. I suspect once your project has been initialized properly with git the authentication issue will disappear as it will now point upstream to your personal repository.
Hopefully that helps!
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.
I am working on webpage, and I need version tracking, so I'm uploading it to github.
Here is the underlying set up.
https://developers.google.com/appengine/articles/wordpress
Now that I have the base CMS ready to go, I need to get the base code uploaded before I start making changes.
lloydm#lloydm-E6320:~/Downloads/rtt/rtt-code$ pwd
/home/lloydm/Downloads/rtt/rtt-code
lloydm#lloydm-E6320:~/Downloads/rtt/rtt-code$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# wordpress/
nothing added to commit but untracked files present (use "git add" to track)
lloydm#lloydm-E6320:~/Downloads/rtt/rtt-code$ ls
app.yaml cron.yaml php.ini wordpress
lloydm#lloydm-E6320:~/Downloads/rtt/rtt-code$ git add .
fatal: Not a git repository: wordpress/wp-content/plugins/../.git/modules/appengine-wordpress-plugin
I've never used github before, so I was just following the github website stuff. I have zero idea what this error means or how to prevent it. I can't find anything that I think is related to it.
You need to set up your git repo correctly.
I think you followed this section "Installing WordPress on your development environment" from the link you provided https://developers.google.com/appengine/articles/wordpress
So what you did was download WordPress into your folder which you set up to be a .git repository. However, the WordPress project builder you downloaded itself contains a .git repository.
Check if you have a /workpress/.git file. It likely contains something like :
gitdir: ../.git/modules/wordpress
If you do, then that explains the error I think.
As for setting it up correctly, there are many tutorials available.
One way is to use Git for theme deployment, rather than having it manage your entire WordPress installation --> http://culttt.com/2013/04/08/how-to-deploy-wordpress-themes-with-git/
Another way is to add wordpress as a submodule http://www.efeqdev.com/website-development/this-is-how-we-version-control-and-deploy-our-wordpress-websites-with-git/
or Just make a ~/Downloads/rtt/rtt-code/wordpress/myWebpage directory and set up a git repo in it. http://www.whistlenet.com/git-for-wordpress/
I think you just need to go into the wordpress folder and then run the git status command. As the directory(rtt-code) is not a git directory but contains within it the git repo, that is wordpress, you are getting this error.
Inside the wordpress folder, all your git commands would work perfectly well...
I followed the instructions for installing Django CMS on my mac. When I run "manage.py cms check", everything is fine, except it says it cannot find the template_1.html. When I go into the admin to create a page, the template is in the Template drop down. When I try to save the page it gives me "TemplateDoesNotExist at /admin/cms/page/add/".
Maybe it's noteworthy, I was having issues with the url prior to this error. I was not able to open the admin or even get main page to render in the browser. After searching stack overflow I found the same issue. I changed the url patterns from the "urlpatterns = i18n_patterns" to the standard. That worked. Now I have this issue. Any assistance would be appreciated. Thanks.
Link to Traceback if needed:
http://dpaste.com/hold/1430437/
I had the same error (on Ubuntu 12.04)
Following the django-cms 2.4.3 installation instruction,
django-admin.py startproject myproject
creates a directory myproject (in which manage.py resides) and a subdirectory, also named myproject, which contains the setting files and the templates directory.
I don't know if this is the intention of the authors of the django-cms doc. But the instruction
os.path.join(PROJECT_PATH, "templates"),
in the TEMPLATE_DIRS setting points to /absolute/path/to/myproject/templates.
This should be changed to:
os.path.join(PROJECT_PATH, "myproject/templates"),
to point to the correct directory /absolute/path/to/myproject/myproject/templates