# URLs broken on all content

**URL:** <https://discourse.gohugo.io/t/urls-broken-on-all-content/31297>\
**Category:** support\
**Created:** [February 18, 2021, 10:57pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297 "2021-02-18T22:57:23Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 18, 2021, 10:57pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/1 "2021-02-18T22:57:23Z")

</div>

Why is the base url being preprended to the url I provide to url\_slides? For instance, let’s say I’m at my site page here: [STAT 5170: Applied Time Series | Taylor R. Brown](https://tbrown122387.github.io/courses/5170.html)

It is referencing the following config file `content/courses/5170/index.md` :

```
---
title: "STAT 5170: Applied Time Series"
date: 2020-07-19
url_slides: "https://github.com/tbrown122387/stat_5170_slides"
---

Feel free to message me directly for other types of materials.

```

But you can see, when you go to that site, and click on the “slides” button, the link is all broken. It refers you to the nonexistent [https://tbrown122387.github.io/https:/github.com/tbrown122387/stat\_5170\_slides](https://tbrown122387.github.io/https:/github.com/tbrown122387/stat_5170_slides)

The first part of that is my base url in `config/_default/config.toml` So hey, why not change base url to baseurl = “” That doesn’t work though. I’ve also tried baseURL = “” No luck.

What’s the deal here?

I can replace the link with something like `[slides]( https://github.com/tbrown122387/stat_5170_slides)`but the button doesn’t look as cool.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 18, 2021, 11:39pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/2 "2021-02-18T23:39:51Z")

</div>

Can you share your config.toml file with us?

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 19, 2021, 3:42am UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/3 "2021-02-19T03:42:54Z")

</div>

Sure, thanks for the response. Here it is:

```
# Configuration of Hugo
# Guide: https://sourcethemes.com/academic/docs/get-started/
# Hugo Documentation: https://gohugo.io/getting-started/configuration/#all-configuration-settings
#
# This file is formatted using TOML syntax - learn more at https://learnxinyminutes.com/docs/toml/
# Each configuration section is defined by a name in square brackets (e.g. `[outputs]`).

# Title of your site
title = "Taylor R. Brown"

# The URL of your site.
# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
#baseurl = "http://people.virginia.edu/~trb5me/"
#baseurl = "https://tbrown122387.github.io/"
#baseurl = ""
baseURL = ""
# Enter a copyright notice to display in the site footer.
# To display a copyright symbol, type `&copy;`. For current year, type `{year}`.
copyright = ""

#https://gohugo.io/content-management/urls/
# was having difficulty writing links in .md files for content
uglyurls = true

############################
## Advanced options below ##
############################

# Get last modified date for content from Git?
enableGitInfo = true

# Default language to use (if you setup multilingual support)
defaultContentLanguage = "en"
hasCJKLanguage = false # Set `true` for Chinese/Japanese/Korean languages.
defaultContentLanguageInSubdir = false
removePathAccents = true # Workaround for https://github.com/gohugoio/hugo/issues/5687

summaryLength = 30 # Listing summary length in words. Also, see `abstract_length` in `params.toml`.
paginate = 10 # Number of items per page in paginated lists.
enableEmoji = true
enableRobotsTXT = true
footnotereturnlinkcontents = "<sup>^</sup>"
ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]

# Workaround Hugo publishing taxonomy URLs as plurals - consistently use singular across Academic.
[permalinks]
  authors = "/author/:slug/"
  tags = "/tag/:slug/"
  categories = "/category/:slug/"
  publication_types = "/publication-type/:slug/"

[outputs]
  home = ["HTML", "RSS", "JSON", "WebAppManifest"]
  section = ["HTML", "RSS"]

[mediaTypes."application/manifest+json"]
  suffixes = ["webmanifest"]

[outputFormats.WebAppManifest]
  mediaType = "application/manifest+json"
  rel = "manifest"

# Configure the Markdown renderer.
[markup]
  defaultMarkdownHandler = "goldmark"
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true # Enable user to embed HTML snippets in Markdown content.
  [markup.highlight]
    codeFences = false # Disable Hugo's code highlighter as it conflicts with Academic's highligher.
  [markup.tableOfContents]
    startLevel = 2
    endLevel = 3

[imaging]
  resampleFilter = "lanczos"
  quality = 90
  anchor = "smart" # Anchor for cropping. Options include Smart and Center.

# Taxonomies.
[taxonomies]
  tag = "tags"
  category = "categories"
  publication_type = "publication_types"
  author = "authors"

# Related content.
[related]
  threshold = 80.0
  includeNewer = true
  toLower = true

  [[related.indices]]
    name = "title"
    weight = 60.0

  [[related.indices]]
    name = "summary"
    weight = 50.0

  [[related.indices]]
    name = "tags"
    weight = 80.0

  [[related.indices]]
    name = "categories"
    weight = 70.0

  [[related.indices]]
    name = "authors"
    weight = 20.0

# Install Wowchemy
[module]
  [[module.imports]]
    path = "github.com/wowchemy/wowchemy-hugo-modules/wowchemy"
  [[module.imports]]
    path = "github.com/wowchemy/wowchemy-hugo-modules/netlify-cms-academic"
```

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [February 19, 2021, 2:19pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/4 "2021-02-19T14:19:24Z")

</div>

Please post the layout, that is transforming the `url_slides` frontmatter. There is probably something like `absURL` in there that will prepend the `baseURL` to the link.

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 19, 2021, 2:55pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/5 "2021-02-19T14:55:09Z")

</div>

What is the “layout?” Is that a file somewhere?

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [February 19, 2021, 2:59pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/6 "2021-02-19T14:59:29Z")

</div>

Yes :). Well… the best would be if you put your repository public for a bit so we can look into it. It does not sound like there is an easier way to find your issue.

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 19, 2021, 4:24pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/7 "2021-02-19T16:24:54Z")

</div>

Everything is available here: [GitHub - tbrown122387/my\_academic\_site\_v2: my website](https://github.com/tbrown122387/my_academic_site_v2)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 19, 2021, 6:07pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/8 "2021-02-19T18:07:18Z")

</div>

This repo was last updated 27 days ago. Please push the changes from your local repo.

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 19, 2021, 7:42pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/9 "2021-02-19T19:42:27Z")

</div>

Done. If you see the latest commit though it only has my attempted fixes

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 20, 2021, 1:16am UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/10 "2021-02-20T01:16:31Z")

</div>

Try this:

```bash
mkdir ~/temp
cd ~/temp
git clone --recurse-submodules https://github.com/tbrown122387/my_academic_site_v2
cd my_academic_site_v2
git revert --no-edit d894070
hugo server

```

Then browse to `http://localhost:1313/courses/5170/`.

When I do this I see a “Slides” button which links to [https://github.com/tbrown122387/stat\_5170\_slides](https://github.com/tbrown122387/stat_5170_slides).

So, all looks well. Or I don’t understand the problem.

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 20, 2021, 6:17pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/11 "2021-02-20T18:17:47Z")

</div>

You’re right, that looks fine when you preview it like that. I guess the problem must be related to how I push the `public/` folder to my [github io site](https://github.com/tbrown122387/tbrown122387.github.io).

This is usually how I do it:

```
cd ~/my_academic_site_v2/
hugo
sudo cp -r public/* ~/tbrown122387.github.io/
cd ~/tbrown122387.github.io/
git add .
git commit -m "yadayadayada"
git push origin main
```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 20, 2021, 7:13pm UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/12 "2021-02-20T19:13:47Z")

</div>

Look at this:  
[https://github.com/tbrown122387/tbrown122387.github.io/blob/main/courses/5170/index.html#L795](https://github.com/tbrown122387/tbrown122387.github.io/blob/main/courses/5170/index.html#L795)

Note the leading `/` in the `href` attribute:

```auto
href="/https:/github.com/tbrown122387/stat_5170_slides"

```

Let me suggest the following:

1. Delete your `public` folder
2. Set baseurl to `https://tbrown122387.github.io/`
3. Commit and push your changes.
4. Rebuild the site using the steps in your last post.

---

<div class="post-metadata">

**Author:** ![tbrown122387](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tbrown122387/32/13641_2.png) [@tbrown122387](https://discourse.gohugo.io/u/tbrown122387)\
**Post date:** [February 21, 2021, 1:47am UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/13 "2021-02-21T01:47:39Z")

</div>

Hey now, it works! thanks! That fixed it.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 23, 2021, 1:48am UTC](https://discourse.gohugo.io/t/urls-broken-on-all-content/31297/14 "2021-02-23T01:48:01Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
