Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
How to insert current date shortcode for hugo website

So far I have successfully put an iframe shortcode on my site.

What I want to do is put today's date into the iframe url where I have the date, like this where I have an old static date:

{{< charts "https://unnamed.website/dontguess/performance_chart_viewer.aspx?environment=DEV&date=2022-03-31&type=Daily_CPU" >}}

Here is my "charts" shortcode definition for the iframe:

<iframe src="{{.Get 0}}"&type=Daily_CPU width="1080" height="800" frameborder="0"></iframe>

Here is my "date" shortcode with some javascript to get today's date:

<script>
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();

today = yyyy + '-' + mm + '-' + dd;
document.write(today);
</script>

I have been trying a hand full of things and nothing seems to work right, so far.

I thought this would have worked in the iframe shortcode definition, but it does not:

<iframe src="{{.Get 0}}{{< date >}}"&type=Daily_CPU width="1080" height="800" frameborder="0"></iframe>

Clearly I'm doing something wrong here. Can you help me? Is there an easier way that I'm not thinking of?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Untested but should lead you in the right direction...

{{< charts "https://unnamed.website/dontguess/performance_chart_viewer.aspx?environment=DEV&date=2022-03-31&type=Daily_CPU" >}}

Becomes:

{{< charts "https://unnamed.website/dontguess/performance_chart_viewer.aspx?environment=DEV&date={{now.Format | "YOUR NEEDED FORMAT HERE"}}&type=Daily_CPU" >}}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!