# Want to change markdown of content while build. Possible?

**URL:** <https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045>\
**Category:** feature\
**Created:** [February 19, 2023, 9:04pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045 "2023-02-19T21:04:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bublick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bublick/32/10428_2.png) [@bublick](https://discourse.gohugo.io/u/bublick)\
**Post date:** [February 19, 2023, 9:04pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/1 "2023-02-19T21:04:52Z")

</div>

I’m going to include a pageview counter using a simple external key-value storage. Is there a way to `read` value from the API on the fly, while Hugo builds? Or right before the build. Is this possible?

---

<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, 2023, 9:07pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/2 "2023-02-19T21:07:44Z")

</div>

[https://gohugo.io/hugo-pipes/introduction/#get-resource-with-resourcesget-and-resourcesgetremote](https://gohugo.io/hugo-pipes/introduction/#get-resource-with-resourcesget-and-resourcesgetremote)

---

<div class="post-metadata">

**Author:** ![bublick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bublick/32/10428_2.png) [@bublick](https://discourse.gohugo.io/u/bublick)\
**Post date:** [February 19, 2023, 9:14pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/3 "2023-02-19T21:14:02Z")

</div>

Sorry, I’m looking for a way to save markdown with a new value. Will this help?

---

<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, 2023, 9:15pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/4 "2023-02-19T21:15:48Z")

</div>

Sure.

markdown

```plaintext
There have been {{< num-visits >}} visits to this page.

```

Then in `layouts/shortcodes/num-visits.html` you call the external api with `resources.GetRemote`.

---

<div class="post-metadata">

**Author:** ![bublick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bublick/32/10428_2.png) [@bublick](https://discourse.gohugo.io/u/bublick)\
**Post date:** [February 19, 2023, 9:39pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/5 "2023-02-19T21:39:17Z")

</div>

This was not too clear, so I continued to explore and found [Add .RenderShortcodes · Issue #7297 · gohugoio/hugo · GitHub](https://github.com/gohugoio/hugo/issues/7297)  
Basically, this is not what I have looked for initially. Initially, I wanted a kind of PreProcessor that will get value from API and save a simple integer value in the front matter. But… this may be useful too.

---

<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, 2023, 9:50pm UTC](https://discourse.gohugo.io/t/want-to-change-markdown-of-content-while-build-possible/43045/6 "2023-02-19T21:50:35Z")

</div>

> [@bublick](#):
>
> PreProcessor

If you’re going to do that, write the results to one or more json/yaml/toml files to the data directory.

Why don’t you just do this client-side?
