Is there a way to create 'docs' style internal project post in hugo academic? - r

Following on from this question and answer, I was wondering if it is possible to create an internal project post in Blogdown and hugo academic that is structured like a "Courses" document?
My current thought is to create a 'hidden' courses section that can be linked to by a project, however, relative paths like external_link: "courses/my-example-course" don't seem to work. I suppose I could provide an https link after publishing, but this seems inefficient.
Does anyone have any suggestions?
Thanks,

So it turns out that it just wasn't working in the RStudio viewer, which I use instead of Chrome because it is unusably slow on my laptop. It's opening another tab, but that's to be expected with an external link.
The working solution is to use external_link: /courses/my-example-course, and it's important to have the first /, otherwise it returns a 404 page.

Related

Sharing buttons in academic theme not working on blog post

I am sure this issue has a relatively straightforward solution, but I am a general web development novice, new to blogdown specifically, and just created my first site.
Aside from this one issue, everything is working great. In fact, I generally love the functionality, but I am having trouble getting the sharing buttons on my blog post to function properly. The issue is that a reader can share the title of a blog, on say Twitter, but it does not generate a URL for the post.
The result is that you get a Tweet with nothing linked... which is not helpful.
Leading to this not very actionable Tweet:
Instead what I want is this:
Here is the specific page where it is a problem:
https://mgb-research.netlify.com/post/gaussian-process-imputation-models/
And here is my Git repo with the site files:
https://github.com/matgbar/main_site
I can see that the button is referencing post/gaussian-process-imputation-models/, but it is not including the equally important: https://mgb-research.netlify.com/ in front of the page info.
I have tried tinkering with certain settings, including relativeruls=false vs. true. Nothing seems to make a difference that I have done so far.
I had the same problem. Instead of adding it to each post. I found a related issue where Yihui Xie recommends setting the baseURL on the config.toml file and then build the site:
serve_site() is only for local preview. If you want to publish the site, you need to run blogdown::build_site() so that baseurl is actually written to all pages.
After a number of different approaches to this problem, I resolved it by adding the baseurl: to each page's header (see image below).
The page now renders full links using the sharing buttons.

Font awesome icons not showing in Wordpress after site address URL change

This may be an obvious question for those of you more advanced in coding than myself...but I created a website in WordPress but their domain is hosted elsewhere. They changed the A name and it now points to the site, but the font awesome icons are now square boxes. How can I fix this? Is there a simple way?
Many thanks for any help/guidance.
Alison
Super late, but hopefully this saves someone a lot of time. After migrating an existing Wordpress site to a new domain, I too encountered icons missing (both on the front-end and the back-end administration). After a long search and applying different methods, I found the database still listed the original/old domain within the "option" table.
Using phpMyAdmin, select the "option" table. Within "option" you will see the "site" and "home" rows. If the value has the old domains, you will need to change it to match the sites URLs (Located on the Administration dashboard under Settings > WordPress Address (URL) & Site Address (URL). To change the value, click Edit > and update the URL.
Fix the problem in less then 2 mins. Simple replacement of /font-awesome/5.13.0/css/fontawesome.min.css with /font-awesome/5.13.0/css/all.min.css and also font-awesome/5.13.0/js/fontawesome.min.js with /font-awesome/5.13.0/js/all.min.js can fix this issue. https://youtu.be/_GV_pEmLCLU
I know this is 2 years old, but I just ran into a similar problem and the answer given by Owais did not feel right to me (getting CSS from another site).
This happened to me for the exact same reason as it did for OP. I migrated my website to another host and another domain-name. After doing that I ran a rename-script for the DB (thousants of hard-coded URLs were replaced).
However, as it turns out, my theme was also using hard-coded URLs in the CSS files and in some JS files, as they were generated (upload/fusion-scripts and upload/fusion-styles). After replacing the hardcoded URLs in these files (I used visual studio, but you can use any bulk-replace tool) everything worked fine again.
Just another idea to throw in here - after transferring the site to the new server, and running this handy script to replace all references of the old url with the new one, I was still having the same issue with font awesome. The solution was to go to Settings / General and set the Endurance Cache to Off (0). Refreshed the site and all was well.
In my case, I had that problem changing the url using the constants WP_HOME WP_SITEURL at wp-config.php
When I changed through the wp-admin using the RELOCATE flag, worked
As you may know, this is the official doc about it
I had this problem so many times but this time I found the full proof solution for this issue:
Open PhpMyAdmin and then click on wp_options table.
In this, you will see a table with a name(according to your theme name) something like "theme_options_css" edit it and change the URL from old to new.
The problem might occur due to Http to Https migration also. So for that also change Http to Https manually in the same table and the problem will be resolved the moment you save your table.

Dnn 2sxc Blog Module sub-directory

I am testing out DNN 8 and am using the blog app and content management from 2sxc (great module, BTW!).
I have the recent blog post listed on a page sub-directory called '/articles'. But I also wanted some of them listed on the home page as well. When I add the app or module to the home page the url is '/home/post/post-title-here' while on the /articles page the urls are '/articles/post/post-title-here'. This creates the illusion that I have two directories with duplicate blog posts (which probably will get me some dings for SEO for duplicating the same content).
How do I get the app to use the common directory '/articles' regardless of where I put the module/app on the site? I've looked at settings all over and don't see anything that pops out at me. Also not sure if this is a DNN setting or a setting specifically to the extension. Finally, I'd like to be able to keep the year/date/month parts of my url as well as they were on the old site. I assume making that change would probably be similar with the solution to my original question. If that's a different fix, then let me know and I'll put it into a new thread. Thanks in advance!
This question is basically about the blog-app. Now if I understand you correctly, your question is "Can I have multiple lists on various pages, but all of them still link to my main details page". The answer is yes, but the exact solution depends a bit on what you need.
So basically there is a setting in the app-settings to define the main page. I believe it's empty by default, so that the blog-app works automatically without you having to configure anything. But AFAIK if you set that, all blog-details-links will use that as the only source.

Google Adword not working /conversion.js not found

I'm currently working on a wordpress site. My task is just to add the conversion script in a thankyou page. I added the script here: http://www.livingedge.co.nz/thanks-for-getting-in-touch/ , unfortunately does not work. It says that a conversion.js was not found.
See the attached screenshot: http://screencast.com/t/52ixQUzHKNxZ
I added the conversion script on the footer put it in a conditional so that it will load only on the thakyoupage.
I'm new to this and can't figure out what would be the possible cause of such problem.
I tried adding the script in the header, on the page editor, on a form redirect.
Q: What could be the possible cause of this issue?
The URL you are using for the conversion script is incorrect — the correct one has "www" in the domain name.
The fact that you've got this link wrong makes me think you may be looking at incorrect directions.
Follow the instructions given in the Google documentation page "Setting up conversion tracking" precisely.

Find every instance of a CSS id/class across a whole site

Before making a CSS change that might possibly have unintended consequences, what's a good way to find where else on the whole site (not just this page) that id or class is used? (It doesn't have to be exhaustive, and semi-manual processes are ok, too.)
For a bit of context, it's a Joomla-based site with a lot of content, and I'm not yet familiar with most of it. The id in question has a two letter name, and I have no idea where else it might be used. I don't have direct access to the server for any grep-like approaches.
The only technique I can think of is using Stylish to make an obvious change to that one selector, and browsing the site for a bit to see where it pops up.
The easiest way would be a local grep, but since you don't have access to the server, try downloading it locally using wget:
wget -r -l --domains=http://yourdomain.com http://yourdomain.com
That'll recursively retrieve pages from your domain to an infinite depth, but only following links to pages within your domain.
Once it's on disk, do a local grep and you're golden.
I use unused-css.com for this sort of thing. You simply put in your webpage, and it will look through the whole site (incl. login) and give you the CSS that you actually are using.
I've found it to be 95% correct - but it only doesn't pick up on things like some CSS browser hacks and some errors (ie. the CSS only displays after an error), so it should work fine for this.
You could also check the original template (assuming the template is a commercial one) to see where the id perhaps should be (they usually lay everything out in their demo template), but unused-css won't tell you exactly where it is used, only if it is or not. For that, I'd start with a view-source -> find on the major pages, and then try other mentioned solutions.
Get the whole site's source tree into an IDE like NetBeans or Eclipse and then do a recursive search for id="theid" on the root folder.
If this is not possible, how are you updating the CSS?
Assuming you don't want to do the grep approach:
Is the ID in question appearing in the actual content area of the page, or in the 'surrounding' areas? If it seems like it's not part of the content, but rather appears in a template, you could search the template files for it. As you're updating the CSS, I'm going to assume you can at least get a hold of the template files. Many text editors/IDE's will let you do a 'global search'. I'd load the template files in TextMate (my texteditor of choice) and do a "search in project" for the particular ID.
That will at least give you a semblance of an idea of where in the site that ID shows up. No, it won't be every 'page', but you'll know what kind of page it appears on (which, with a CMS, is really what you're after).
If the ID in question appears in the content, that is, it was hand-entered by content creators, you'll have to go another route. Do you have access to the database? If you can get a dump of the database (I think Joomla! is MySQL based), you can open the sql in something like Sequel Pro and do a search in the content records for that ID.
This is not actually as hard as it sounds. First place to look the index.php file for the template. This file should be pretty small without a ton of code unless the template is from a developer that uses a template framework. If the ID is in there, then it will show up on every page in the website since this is the foundation that every page is built on.
If you don't find it in there, then you need to determine whether it is displaying in a module position or in the component area. You should be able to tell the difference by looking at the index.php file from the template.
If it's in a module position, then the ID should only show up in instances of that particular module.
If it's in the component area, then it should only display in any pages being created by the component. That does leave the possibility of it affecting many elements you don't want changed. But there is a solution for that. you can use the page class suffix in a menu item to add a unique id/class to the page you want to change (depends on your template). With that unique suffix you can create a specific selector that will only affect the pages you want to change.

Resources