I have 2 posts on my Octopress site, one of which I'm trying to delete. When I go into the source/_posts directory to delete it it's not there. I tried deploying the site again, (I deploy through github pages), but it's not removing the post. How to get I get this post off my Octopress blog?
One way to do this is by using the rsync_delete option in the rakefile. It will delete any file that does not exist in the source. Simply update to rsync_delete:true. If you have more files on your site that you don't want to delete which are not located in the source, take a look at this for a thorough explanation of how to exclude these files.
Related
I've created a website using Rails 6 on Heroku. I need to drop a file into /.well-known/ but I've no idea where that might be.
I created a folder with that name in the root of the project and checked it in to git, but it doesn't show up there.
It seems that I should use a route to do this, but I don't have a handle on the syntax to use. I basically need to expose a /.well-known/longhashedstring.txt to a 3rd party service for about a minute.
See above answer from Sharj. Put your .well-known folder in /public for Rails 6 and all is good.
I am currently working on a project where the majority if the site structure is already in place. I am trying to add a new section to it but am having difficulty getting links to work.
I replicated what another page had however in tutorials I am seeing reference to a routes.rb file which specifies how links work. The problem is i cannot locate the routes.rb file. Is there anything I am missing or is routes.rb specific to a certain version and I am using a different version. Any help would be much appreciated.
I think your routes file was deleted. You can check git status. You will be find deleted file there. Rollback that change or create new file routes.rb in config/ folder.
If the app is a standard Rails app, you should be able to find routes.rb in the app's config/ folder.
How about just using your editor to do a file search and locate the file?
For Sublime Text, cmd + p for MAC will suffice.
I have a Rails app and I want to add a blog feature; my idea is to use Jekyll which is a great blog tool, I just need to figure out if it's possible to use http://my.app.com/blog as a url (knowing that Jekyll will run its own server process with its own url).
Does anybody know of a way to accomplish this? It'd be great to be able to do so. Best regards!
... just need to figure out if it's possible to use http://my.app.com/blog
as a url (knowing that Jekyll will run its own server process with its own url).
While jekyll's web server works, it will be probably easier, simpler and safer to use your rails app's webserver for serving all pages.
The simplest way of doing what you want is hooking a jekyll invocation to your server's git repository, so jekyll's static content is added automatically to your rails app's public/blog/ directory every time there is a push.
Create a symbolink link called public/blog inside your app's public folder. Make it point to the generated _site folder of your jekyll repository.
On the git repository that controls the contents of the jekyll blog, add a post-receive hook that does the following:
#!/bin/sh
rm -rf _site
jekyll
Those are the basic steps. You might have to configure the read permissions properly, ignore the /blog/ link if you are using an SCM (like you should) and automate the link creation if you are using Capistrano or Vlad for deploying.
There are other alternatives, like using a real folder instead of a symbolic link and having jekyll generate stuff directly there, but I feel the one I'm presenting is the cleanest.
Would you be using nginx to reverse-proxy the Rails app? If so, you should be able to just carve out an exception so /blog is served directly by nginx instead of forwarded to Rails.
Check out this gem: https://github.com/zbruhnke/bloggy
And this blog post about it: https://blog.engineyard.com/2012/introducing-bloggy-a-simple-way-to-add-a-jekyll-blog-to-any-rails-application
I had the same problem a few weeks ago. If you really have to use Jekyll, I think the best solution is to use the already mentioned Bloggy gem.
However, I wasn't satisfied with this solution, because you still have to duplicate or synchronize a lot of things like templates, routes, stylesheets, and so on. So I decided to implement my own simple Jekyll-like blog functionality in Rails.
You can find my article describing the implementation here: Create a simple Jekyll-like blog in your Rails 4 app.
For every project it's like having two parts: the Rails application and then all documents and pictures related to it.
I wonder how you organize them both.
Do you put everything under the same project root folder and apply Git on that folder or don't you protect your documents with Git at all?
Then, what if the docs are too sensitive or only for owners of that project. Then I probably should't have it under the same folder right?
How have you structured both your Rails code and belonging business documents?
Share your solutions!
If you're deploying with capistrano, as a lot of Rails apps are, the standard solution seems to be to keep these sorts of assets within the shared folder, and then get cap to symlink them into the application at the point of deploy.
Its redmine, a Ruby on Rails application. Currently, every issue can have one or more files. But if a user decide to update/change them, the old files are replaced. My task is to develop something to allow versioned files for every issue: so, if a user update the content of an existing issue, the previous state of the issue is preserved and it can be displayed in some form.
I'm new to RoR and Redmine development.
I guess the best thing in this case is to modify Redmine so that instead of uploading files to the issue, you put the files into a subversion repository and then add a link in the issue.
Alternatively, allow multiple files to be added, and modify to code to rename them everytime one is uploaded - appending a suffix (_1, _2 etc) to each filename.