Requirement: To get datetimestamp in the main page of the dbt docs site , so that we know when it was last refreshed
Code:
Have created a macro and the macro is been called in the overview.md
macro
{% macro get_date_test() %}
{{ return((date_trunc('day', current_timestamp()) | string).replace('-', '')) }}
{% endmacro %}
under the dbt folder docs>overview.md
{% docs __overview__ %}
This documentation was created-on:: {{ get_date_test }}
{% enddocs %}
dbt_project.yml
docs-paths: ["docs"]
dbt docs doesn’t show the date yet
I tried changing to calling as below , it threw an error as dbt couldn’t recognize the macro
{{ get_date_test() }}