Getting fields' Attributes in node template I'm trying to rendering node's fields directly inside a node template.

This is my node template file node--homepage.twig.html:

&lt;div{{ attributes }}&gt;

  {{ title_prefix }} {{ title_suffix }}

  &lt;div{{ content_attributes }}&gt;

    &lt;!-- Render field_1 value here --&gt;
    &lt;div{# field_1's HTML attributes here #}&gt;
      {{ node.field_1.value }}
    &lt;/div&gt;

    &lt;!-- Render field_2 value here --&gt;
    &lt;div{# field_2's HTML attributes here #}&gt;
      {{ node.field_2.value }}
    &lt;/div&gt;

  &lt;/div&gt;

&lt;/div&gt;


Is it possible to get HTML attributes for each field inside the node template?
The field values in node are the raw data from the database. You should not use them for output. They are great for coding of conditions in twig.

For output use:

{{ content.field_1 }}
{{ content.field_2 }}


These statements will output the fields using the field formatter as configured in the ui. 

Edit: Adding attributes

If you need additional attributes add them in the field twig. The methods described in the link you provided in the question are only possible in the same twig your element comes from. If you want to modify the attributes of the node it is the best to do it in the node template. If you want to add attributes to the field use the field template.